package edu.rit.varapp.datalayer;

import java.util.Date;

/**
 * Represents the modules table in the database.
 */
public class Module {

    private int EntityId;
    private int SerialNumber;
    private String LicenseCode;
    private String Location;
    private Date SupportExpDate = null;
    private int Desktops = 0;
    private int Readers = 0;
    private int Verifiers = 0;
    private int Designers = 0;
    private int ScanStations = 0;
    private int RemoteCaptureStations = 0;
    private int amps = 0;
    private boolean eform = false;
    private boolean TechSupport = false;
    private boolean FirstLine = false;
    private String ScannerModel = null;
    private String Version = null;
    private Date PurchaseDate = null;

    public Module( int EntityId, int SerialNumber ) {
        this.EntityId = EntityId;
        this.SerialNumber = SerialNumber;
    }

    public Module( int EntityId, int SerialNumber, String LicenseCode, String Location, Date SupportExpDate,
                     int Desktops, int Readers, int Verifiers, int Designers, int ScanStations,
                     int RemoteCaptureStations, int amps, boolean eform ) {
        this.EntityId = EntityId;
        this.SerialNumber = SerialNumber;
        this.LicenseCode = LicenseCode;
        this.Location = Location;
        this.SupportExpDate = SupportExpDate;
        this.Desktops = Desktops;
        this.Readers = Readers;
        this.Verifiers = Verifiers;
        this.Designers = Designers;
        this.ScanStations = ScanStations;
        this.RemoteCaptureStations = RemoteCaptureStations;
        this.amps = amps;
        this.eform = eform;
    }

    public Module( int EntityId, int SerialNumber, String LicenseCode, String Location, Date SupportExpDate,
                     int Desktops, int Readers, int Verifiers, int Designers, int ScanStations,
                     int RemoteCaptureStations, int amps, boolean eform, boolean TechSupport, boolean FirstLine,
                     String ScannerModel, String Version, Date PurchaseDate ) {
        this.EntityId = EntityId;
        this.SerialNumber = SerialNumber;
        this.LicenseCode = LicenseCode;
        this.Location = Location;
        this.SupportExpDate = SupportExpDate;
        this.Desktops = Desktops;
        this.Readers = Readers;
        this.Verifiers = Verifiers;
        this.Designers = Designers;
        this.ScanStations = ScanStations;
        this.RemoteCaptureStations = RemoteCaptureStations;
        this.amps = amps;
        this.eform = eform;
        this.TechSupport = TechSupport;
        this.FirstLine = FirstLine;
        this.ScannerModel = ScannerModel;
        this.Version = Version;
        this.PurchaseDate = PurchaseDate;
    }

    public int getDesigners() {
        return Designers;
    }

    public int getDesktops() {
        return Desktops;
    }

    public int getEntityId() {
        return EntityId;
    }

    public boolean isFirstLine() {
        return FirstLine;
    }

    public String getLicenseCode() {
        return LicenseCode;
    }

    public String getLocation() {
        return Location;
    }

    public Date getPurchaseDate() {
        return PurchaseDate;
    }

    public int getReaders() {
        return Readers;
    }

    public int getRemoteCaptureStations() {
        return RemoteCaptureStations;
    }

    public int getScanStations() {
        return ScanStations;
    }

    public String getScannerModel() {
        return ScannerModel;
    }

    public int getSerialNumber() {
        return SerialNumber;
    }

    public Date getSupportExpDate() {
        return SupportExpDate;
    }

    public boolean isTechSupport() {
        return TechSupport;
    }

    public int getVerifiers() {
        return Verifiers;
    }

    public String getVersion() {
        return Version;
    }

    public int getAmps() {
        return amps;
    }

    public boolean isEform() {
        return eform;
    }

    public static String columnsToSQL() {
        return "EntityId,SerialNumber,LicenseCode,Location,"
               + "SupportExpDate,Desktops,Readers,Verifiers,"
               + "Designers,ScanStations,RemoteCaptureStations,"
               + "amps,eform,TechSupport,FirstLine,ScannerModel,"
               + "Version,PurchaseDate";
    }

    public String valuesToSQL() {
        return  EntityId + "," + SerialNumber + "," + LicenseCode + "," +
                Location + "," + SupportExpDate + "," + Desktops + "," +
                Readers + "," + Verifiers + "," + Designers + "," +
                ScanStations + "," + RemoteCaptureStations + "," +
                amps + "," + eform + "," + TechSupport + "," + FirstLine + "," +
                ScannerModel + "," + Version + "," + PurchaseDate;
    }
}
